package org.mall.framework.util;

import org.springframework.beans.BeanUtils;

public class ObjectUtils {

    /***
     * 业务逻辑判断
     * 前提条件为 入参都为空 也是不相等
     * */
    public static boolean StringsIsEquals(String s1,String s2){
        if (s1==null||s2==null){
            return false;
        }
        return s1.equals(s2);
    }

    public static <T> T copyProperties(Object o,Class <T> tClass){

        T t= null;
        try {
            t = tClass.newInstance();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        BeanUtils.copyProperties(o,t);
        return t;
    }
}
